import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 刘柄华
 * Date: 2022-06-04
 * Time: 17:38
 */

//洗牌
public class TestDemo02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int num = sc.nextInt();
            int k = sc.nextInt();
            int[] arr = new int[num * 2];
            for (int j = 0; j < arr.length; j++) {
                arr[j] = sc.nextInt();
            }
            xipai(arr, k);
        }
    }

    private static void xipai(int[] arr, int k) {
        int len = arr.length;
        while (k>0){
           int[] ret = new int[len];
            int sta = (len-1)/2;
            int end = len-1;
            for (int i = 0; i < len; i++) {
                if(i%2==0){
                    ret[i] = arr[end--];
                }else {
                    ret[i] = arr[sta--];
                }
            }
            arr = ret;
            k--;
        }
        printCard(arr);
    }

    public static void printCard(int[] cards) {
        for (int i = cards.length - 1; i > 0; i--) {
            System.out.print(cards[i] + " ");
        }
        System.out.println(cards[0]);
    }
}
